<%-- 
    Document   : queryRpt
    Created on : 2017-3-7, 14:19:17
    Author     : 52461
--%>

<%@page import="com.cxhd.pacs.DataConfig"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=0.8,user-scalable=no">
        <title><%=DataConfig.getInstance().getConfig().get("systemName")%></title>
        <link rel="icon" href="${base}/favicon.ico" type="image/x-icon">
        <link href="${base}/css/bootstrap-paper.css" rel="stylesheet">
        <link href="${base}/css/font-awesome.css" rel="stylesheet">
        <link href="${base}/css/layui.css" rel="stylesheet">
        <link href="${base}/css/nprogress.css" rel="stylesheet">
<!--        <link href="${base}/css/datepicker3.css" rel="stylesheet">-->
        <script type="text/javascript" src="${base}/js/nprogress.js"></script>
        <script type="text/javascript" src="${base}/js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="${base}/js/angular/angular.min.js"></script>
        <script type="text/javascript" src="${base}/js/jquery.cxhd.js"></script>
        <script type="text/javascript" src="${base}/js/layui.all.js"></script>
        <script type="text/javascript" src="${base}/js/angular-base.js"></script>
<!--        <script type="text/javascript" src="${base}/js/bootstrap-datepicker.js"></script>
      <script type="text/javascript" src="${base}/js/bootstrap-datepicker.zh-CN.js"></script>-->

        <script src="${base}/js/angular/ui-bootstrap-tpls-0.12.0.min.js"></script>
        <style>

            /*            .center{
                            position: fixed;
            
                            text-align: center;
            
                            left:50%;
                            top: 50%;
            
                            -webkit-transform: translate(-50%,-50%);
                            -ms-transform: translate(-50%,-50%);
                            transform: translate(-50%,-50%);
                        }*/
        </style>
    </head>
    <body ng-app="queryRpt" ng-controller="mainCtrl">
        <ul class="layui-nav" lay-filter="">

            <li style="color: #c2c2c2;line-height: 60px;text-align: center;font-weight: bold;font-size: 22px;" >报告查询</li>
        </ul>

        <div class="row center" style="margin: 20px; margin-top: 150px;">


            <div class="layui-form-item">
                <label  style="font-size: 20px;">姓&nbsp;&nbsp;&nbsp;名</label>
                <input type="text" name="title" ng-model="name" lay-verify="title" autocomplete="off" placeholder="" class="layui-input">

                <!--                            <label style="width: 110px;font-size: 18px" class="layui-form-label">姓&nbsp;&nbsp;&nbsp;名</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="title" ng-model="name" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">
                                            </div>-->
            </div>



            <div class="layui-form-item">
                <label  style="font-size: 20px;">手机号</label>
                <input type="text" name="username" ng-model="phone" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">

                <!--                <label style="width: 110px; font-size: 18px" class="layui-form-label">手机号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="username" ng-model="phone" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>-->
            </div>
            <!--            <div class="layui-form-item" >
                            <label style="width: 110px;" class="btn-primary btn btn-lg layui-form-label">发送验证码</label>
                            <div class="layui-input-block">
                                <input type="text" name="username" ng-model="yzm" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div>
                                            <button style="width: 110px;" class="layui-form-label btn-primary btn btn-lg" >发送验证码</button>
                        </div>-->
            <div class="col-lg-12" style="margin-top: 50px;">
   <button ng-disabled="btn" id="query" ng-click="queryInfo()" class="btn-primary btn btn-lg btn-block">查询</button>
<!--                <div class="layui-form-item">
                    <label style="width: 110px;" class="layui-form-label"></label>
                    <div class="layui-input-block">
                     
                    </div>
                </div>-->

            </div>

        </div>




        <div class="modal fade mode-checkPhone" role="dialog" aria-labelledby="gridSystemModalLabel">
            <div class="modal-dialog " role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h3 style="font-size: 24px; font-weight: bold" >手机验证</h3>
                    </div>
                    <div class="modal-body">
                        <label  style="font-size: 20px;">请输入手机上收到的验证码</label>

                        <input type="text" name="username" ng-model="yzm" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">





                    </div>
                    <div class="modal-footer">
                        <button  style="font-size: 20px;" ng-click="checkPhone()" type="button" ng-disabled="!yzm" class="btn btn-success btn-block" >确定</button>
                        <!--<button  data-dismiss="modal" type="button" class="btn btn-primary btn-sm"><span class="fa fa-save"></span>&nbsp;&nbsp;确定</button>-->
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

    </body>
</html>
<script>
    //注意：导航 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element();

        //…
    });
    angular.module("queryRpt", ['baseModule', 'ui.bootstrap'])

            .controller("mainCtrl", function ($scope, base) {

                $scope.queryInfo = function () {

                    if (!$scope.name) {
                        steveAl("请输入名字", 1000);
                    } else if (!$scope.phone) {
                        steveAl("请输入手机号", 1000);
                    } else {
                        checkInfo();
//                    if($scope.myyzm){
//                        
//                    }

                    }
                }
                var checkInfo = function () {
//                    $(".mode-checkPhone").modal("show");
//                    disableBtn();
//                    return;
                    base.post("checkInfo", {name: $scope.name, phone: $scope.phone}).get(function (data) {
                        if (data == 'false') {
                            steveAl("查不到您的信息", 1000);
                        } else if (data) {
                            $(".mode-checkPhone").modal("show");
                            disableBtn();
//                          location = "/MedicalInfo/other/openMobileDetail?host_id=" + data.host_id;

                        }
                    })
                }

                var time1 = 0;
                var time2 = 30;
                var disableBtn = function () {
                    $scope.btn = true;
                    timeNum();
                }

                var timeNum = function () {
                    setTimeout(function () {
                        time2--;
                        if (time2 != time1) {
                            $("#query").text(time2);
                            timeNum();
                        } else {
                            $scope.btn = false;
                            $("#query").text("查询");
                            time2 = 30;
                            $scope.$apply();
                        }


                    }, 1000);
                }

                $scope.checkPhone = function () {
                    base.post("checkyzm", {yzm: $scope.yzm}, function (data) {
                        if (data == "false") {
                            steveAl("验证码错误", 1000);
                        } else {
                            location = "http://125.71.203.61:9061/MedicalDesktop/admin/patView2.jsp?selectPID=BY800006744&sAge=47Y";
                            //location = "/MedicalInfo/other/openMobileDetail?host_id=" + data.host_id;
                        }
                    })
                }
            })

</script>
